﻿package com.media.displays{

	import flash.display.Sprite;
	import com.media.controllers.MediaController;
	import com.events.MediaEvent;
	
	public class SWFDisplay extends MediaDisplay {
		private function attachSWFLoader(pEvent:MediaEvent):void {
			createMediaClip();
			Sprite(_mediaClip).addChild(Sprite(getController().media));
		}
		override protected  function createMediaClip():void {
			super.createMediaClip();
			_mediaClip=addChild(new Sprite  );
		}
		override public  function setController(pController:MediaController):void {
			super.setController(pController);
			getController().addEventListener(MediaEvent.LOAD,attachSWFLoader,false,0,true);
			getController().addEventListener(MediaEvent.METADATA,setMetadata,false,0,true);
		}
	}
}